I tried utilizing
yield() and it works just fine for me.
yield() should be included as a native part of c++, not any particular part of GDScript. I simply included the
<thread> library in my cpp code and was able to use it.
Alternatively, I'm not sure which compiler you are using, but your settings might be wrong. I am using g++-7 on linux, thus requiring the thread library to do my build (-lpthread option). I can also cross-compile this properly for windows using mingw with the pthread lib for mingw installed.
What error message are you receiving when trying to use