properly build on mac os x. Append macosx-only flags only on mac os x