Why do you care what version of GTK+ C::B is using during runtime?
You can build and run gtk2 apps from C::B-gtk3 and vice versa.
You can find night build packages here:
https://launchpad.net/~fuscated/+archive/ubuntu/codeblocks-nightlyGenerally Ubuntu 20.04 is using gtk3 and more importantly wxgtk based on gtk3.
So if you want to make a C::B which uses GTK2 you'll have to compile a custom version of wxgtk and then use it for C::B.
If you're a autotools beginner you'll have a hard time doing this.
What is the full output of configure?
It should be trying to detect GTK3. I don't know why it tries to detect GTK2.
Probably you don't have the wxgtk devel packages installed.