Link against libpam if it's available

The logic looking at c-client's linkage.h file is too clever. (hah)
Just follow PHP's example and always link it when possible.

Closes #1181