Make Error in /usr/bin/ld

Hi all, I successfully make the model in both cluster and mac, but when I try to make this model in my linux machine, I receive this error. Anyone has any idea?

--- Compiling, linking C++ code ---
g++ -DSTAN_THREADS -pthread -std=c++1y -pthread -Wno-sign-compare     -O3 -I src -I stan/src -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.69.0 -I stan/lib/stan_math/lib/sundials_4.1.0/include    -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION     -c  -x c++ -o BIRD/c2_20cores_multi20.o BIRD/c2_20cores_multi20.hpp
g++ -DSTAN_THREADS -pthread -std=c++1y -pthread -Wno-sign-compare     -O3 -I src -I stan/src -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.69.0 -I stan/lib/stan_math/lib/sundials_4.1.0/include    -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION                   src/cmdstan/main.o stan/lib/stan_math/lib/sundials_4.1.0/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_4.1.0/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_4.1.0/lib/libsundials_idas.a  BIRD/c2_20cores_multi20.o -o BIRD/c2_20cores_multi20
/usr/bin/ld: _ZN4stan4math22AutodiffStackSingletonINS0_4variENS0_15chainable_allocEE9instance_E: TLS reference in BIRD/c2_20cores_multi20.o mismatches non-TLS definition in src/cmdstan/main.o section .bss._ZN4stan4math22AutodiffStackSingletonINS0_4variENS0_15chainable_allocEE9instance_E[_ZN4stan4math22AutodiffStackSingletonINS0_4variENS0_15chainable_allocEE9instance_E]
/usr/bin/ld: BIRD/c2_20cores_multi20.o: error adding symbols: bad value
collect2: error: ld returned 1 exit status
make: *** [make/program:41: BIRD/c2_20cores_multi20] Error 1

Hi,
I can’t really help as I am not a Linux person, but it might be useful to know your gcc version and possibly other configurations of your machine.
In a related thread: Trouble building the Bernoulli example (Windows 10, cmdstan 2.19.1) the problem was solved by upgradint to RTools 3.5.

If that doesn’t help, maybe @roualdes or @syclik might be able to help?

If you managed to work around this, please share!
Thanks!