waf: check misc options before everything else

Fixes static builds.