Fix define check for FreeBSD

Also add other BSD defines that are likely needed.

(Aside: the makefile requires GNU Make; it doesn't work with FreeBSD's BSD make)