Makefile: add Freebsd cflags/ldflags
add BSD support
add some logging
Merge branch 'bsd'