fix build scripts to be a little more portable