Move linker flags into the settings file; fixes #4862