おそらく基本的な質問だとおもいますが
-lpthreadのリンクを下のようにMakefileで記述するとcannot find -lpthreadという
エラーがでてしまいます。

test:main.o sub.o
gcc -o test main.o sub.o -lpthread
main.o:main.c test.h
gcc -c main.c test.h
sub.o:sub.c test.h
gcc -c sub.c test.h

コンソールで一つずつコンパイルしていけば問題はないんですが・・・
よろしくおねがいします