Some minor fixes for OSX related to libraries (linking shared libs and DYLD
vs. LD).