change linking order such that pthread comes in the back

This resolves an error with the static gflags library which would
other wise not link properly with an undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
error under Ubuntu 14.04.
Merge pull request #1223 from baeuml/fix_pthread_link_cmake

[fix] set pthread last in linking order for gflags for CMake