fix boost macros on non-GNU systems

Both boost_system and boost_filesystem macros rely on the GNU `tac` tool and sed behaviour which isn't compatible with POSIX systems, like Mac OS X. This updates both files with upstream fixes from autoconf-archive; one patch is already in the repository, the other has been submitted.

I've tested, and this fixes the Gource configure script on OS X.