Fix shared library build issue on FreeBSD 10.