mysql-udf-regexp requires not only a source tree of MySQL, it also needs to have the configure process run at least once there (#6). Because it checks for mysql_version.h and mysql_version.h.in to be in the same directory this will not work for out-of-tree builds (with different directories for the pristine source and the configure-generated or object files).