Fixes to discover.ml: calling the linker with compiler flags is bad and causes failures under Windows.