Search for pthread in order to fix compilation error on ubuntu.