I have seen this too just running "make THREADS=8". Looks like it's because the other tests in this directory are cleaning too aggressively. From the Makefile:
...
clean:
rm -f *.o *.hi
T6145: clean
'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc T6145
./T6145 "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
...
so ghcApi.o is getting removed before the final link step, I would guess.
Regards,
Reid Barton