I've tidied up the code in both of the build scripts used for *nix-like
systems, and the macOS/OSX specific build script helper.
This has been tested on Linux with no issues, but this PR will hopefully
indicate if the changes run without issues on macOS as well.
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>