Fix flex for building on darwin systems

Fixes #2246