Fix builds for Ubuntu (link pthread)