MakefileGenerator: only remove flags that match as a whole

On the Mac this was incorrectly removing -w from -Wno-write-strings
Merge topic 'fix-remove-forbidden-flags' into next

9c57bd5 MakefileGenerator: only remove flags that match as a whole