put LDFLAGS at the end
add thread status variable