Added pkg-config support

This patch adds pkg-config support. This has been tested on OS X and FreeBSD using the expat parser. No tests with the libxml parser have been made.
Move `PC_LIBS` out of AC_CHECK_LIB() just to avoid duplication:
```
if test "x$PLATFORM" != xfreebsd; then
        AC_CHECK_LIB()
        PC_LIBS+=(-lresolv)
else
```

Isn't `-lresolv` added to LIBS twice in your patch? AC_CHECK_LIB() should add it implicitly.