Moved AC_CONFIG_FILES in the main configure.ac
Fix dodgy  replacement inside AC_DEFUN. Now PGI compiles properly.