Use Boost macros from autoconf-archive

Imported from upstream commit 5abd4cfbe611

This speeds up ./configure a lot on my system

time ./configure --enable-unit-tests --with-modules='remote' \
--with-dynmodules='' --disable-silent-rules \
--disable-dependency-tracking --enable-tools >/dev/null

Before:
real	0m30.989s
user	0m18.538s
sys	0m12.078s

After:
real	0m5.373s
user	0m3.073s
sys	0m2.529s

Fixes #890
Add BOOST_LDFLAGS to LDFLAGS

Fixes building on FreeBSD
Merge pull request #1996 from rubenk/use-boost-autoarchive-macros

Use Boost macros from autoconf-archive