various fixes for the build scripts

Signed-off-by: Bernard `Guyzmo` Pratz <guyzmo+github@m0g.net>