Remove getopt usage in build scripts

This should fix things on MacOS