add -pthread to LIBS for BSD