Configure only checks for papi library but does not check headers which are required for compile with library. Fixed locally by checking for headers first and checking for library if header is found: AC_CHECK_HEADERS([papi.h],AC_CHECK_LIB([papi],[main]))
Migrated from: https://sourceforge.net/p/blitz/bugs/70/
As reported by @kmjohnson3: