Fix linker flags with clang, close #5820

Use -B{dynamic,static} switch to link objects in correct order.

see also: https://svn.boost.org/trac/boost/ticket/5820