Add support for building shared libraries on Mac OS X