fix dynamic library issue in freebsd