Fix unit-test linkage
Make it work with --as-needed.