According to Stack Overflow and GCC doc, -pthread is the correct way to use pthread. This fix build error on riscv64.