Fix build on NetBSD and with clang.
Fix compilation script to actually work.