Fix cross-compiling between i686 and x86_64 when building SHARED lib.
Credits goes to alexrass.
For Travis CI - switch CI build to use OS X build environment.