Fixed error reporting when build fails.
Fixes undefined references when using Boost.Filesystem.

Currently only in 1.49 version of boost.