Fix build and add support for building with cargo on mac