Porting to FreeBSD

Cleaned up configure.ac to rely on pkg-config more heavily and less on hard-coded library paths. Also removed libresolv check for freebsd.

tested on FreeBSD 8.4 and debian wheezy.