Modify AX_WITH_LIBRARY to generate LDFLAGS and LDLIBS.

Monotone-Parent: add793b70c148f2ac26fcbac6fee5b6af22bac1c
Monotone-Revision: d7e10586735fe8b66dc06f8cfe0841fa38d82e20
Fix PAPI initialisation code.

Monotone-Parent: d7e10586735fe8b66dc06f8cfe0841fa38d82e20
Monotone-Revision: 3b8f629ced99006415691a247d4552f86f25575c