add detection of FreeBSD and NetBSD