Fixes bug in how libraries are checked for in SCons

Previously the library checks didn't work. Also, check for both regular
boost libraries and use boost '-mt' libraries if not found.