Remove uneed libraries and allow to add FLAGS
Ignore env_watcher.so
Handle putenv correctly.