Various fixes to resolve issues with building python modules on OSX

Fixes various python on OSX related issues