Fix linking of executables under GCC