If you are compiling a project that was created with a previous version, MPLAB is probably still using the old plug-in settings.
-Z is no longer used, so that indicates an old plug-in.

If Inherit Global is greyed out, you are editing the global options instead of the files options.
When entering the build options, select your file name, not "Project".

In the build options, change one of the option checkboxes, and click Apply.
Change the option back and click Apply.

Insure that Inherit global is checked then click OK.

This insures that MPLAB saves the current plug-in options to the project.

Any new projects will automatically use the new plug-in options, but existing projects will still have the old options saved.