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.
AC_MSG_ERROR() missed in the last argument. This leads to report that expat found even if it is not installed.