Fixing shared library build on MacOS X