If you want to enter things like $FLEX into C::B options, you'll have to either define a custom variable or an environment variable of that name for it to be substituted automatically. Another option is doing it manually, ie using flex (or whatever) instead of $FLEX. C::B doesn't know what $FLEX is unless you tell it.
Or, since you already have a working custom makefile, you can always just check 'Custom makefile' in your project properties and use that. This does have the disadvantage that you have to keep it up-to-date manually, of course.