Compile/link fixes for the Mac target. Changed it to a static library.

These are blocking issues to accept https://github.com/cocos2d/cocos2d-swift/pull/981.