typo
It's -lpthread not -lpthreads

Otherwise linking fails with missing pthread symbols when building with
with -Dusethreads