In case someone else encounters the same issue, it turns out that net-snmp-config --cflags is responsible for the -std=c99 flag. Disabling SNMP support with --without-net-snmp can be used as a workaround for now.