fix compatibility issues with OS X
Merge pull request #310 from esl/fix_make_for_os_x

fix compatibility issues with OS X