The libpq configure check failed because library flags are not sanitised
before the test, uselessly pulling X11 libraries. Work around that issue
by providing an extra linker flag for ld.bfd archs.
OK landry@ and kmos@ (who tested on sparc64, thanks!)