In Ubuntu, we've applied the attached patch to achieve the following:
* debian/patches/ld-as-needed.diff:
- Fix linking with ld --as-needed by moving the libraries from
LDFLAGS to LIBS.
We thought you might be interested in doing the same.