build-sys: Honor --libdir

This is necessary for Red Hat Enterprise Linux and Debian; which have
"multilib" and "multiarch" respectively that use e.g. /usr/lib64 and
/usr/lib/i386-linux-gnu directories.