Improve error reporting in build_library.

Have test runner print out the cause of library build failure, if it happens.