Modify shared library compilation to support Mac OS as well as linux