Account for changes in boost dependencies

Since <boost/thread/thread.hpp> includes some headers which will already
call a boost_system function, recent versions of boost require
-lboost_system before -lboost_thread will work, resulting in a failure
of this test if not accounted for.

Make it try without -lboost_system first, but try again with it added to
$LIBS if that fails.
Merge pull request #13 from yoe/master

Unix build process now automatically detects whether -lboost_thread requires -lboost_system to work. (Thanks to Wouter "yoe" Verhelst for the fix.)