Make build more cross compile friendly
Fix compilation on OS X