Make sure LD_PRELOAD is only set when we build shared libraries (and