For centos there is wxgtk-devel. For ubuntu libwxgtk-dev.
Nice trick to install the system library to get the requirements, but at least on CentOS 7 this is still wxWidgets 2.8.12 which might not depend on everything that newer releases do. Plus i didn't want the system library on my system.
Today I've compiled wx-master on a clean ubuntu just by installing libgtk-3-dev...
I don't know the situation on Ubuntu, but me too could get wxWidgets to compile with less than my listed dependencies, but then the configure script spills out warnings about disabling certain components because of missing requirements.