updated build script to better build for linux and mac separately