upgraded build system working for macosx