Link static library before dynamic libraries.