Properly check for libpam.so dependency

Without this build errors half way through the build.