explicitly link tools with stdc++ before pthreads to fix compile issue on ubuntu 14