config/wscons: Fix build and add support for NetBSD
This is a copy of !812 (closed) which can't be merged because the source project has been removed.
cc @nia
This is a copy of !812 (closed) which can't be merged because the source project has been removed.
cc @nia