Fixes for OS X and iOS builds with Xcode 6

This patch fixes several issues preventing Makefile builds from working properly when using Xcode 6 on OS X