Fix build system to use awk instead of sed for OSX machines
Merge branch 'fix-build-magic'