Fix building with modern tools

Works on Yosemite with Xcode 6.1, Cmake 3.0.