Fixed issue with static linking of TLS when also building a local static executable