fix bsd: probe for bsd via gcc -v, and omit -ldl there

make works now asis on bsd (tested on openbsd)