Update the OS X build procedure, fixing some compilation failure issues in the process.