fixed examples linking
Merge pull request #325 from patriotyk/master

Reordered linking of static libraries (-lpthread should be after the static library).