Fix build script so that it works when /bin/sh is not bash