extconf: fix flag assignments and check