more FreeBSD compatibility fixes for some build scripts