ensure preserving CFLAGS inherited from the environment
added a target to build linking against the thread-sanitizer

and ensure preserving environment variables when building deps