build-sys: prevent library underlinking

Underlinking can cause subtle bugs like the recent issue with
libnss_myhostname (which was fixed in commit 1e335af7).