Append pthread to LDFLAGS instead of overwriting LDFLAGS
Fix to issue #117