Force using gtk3 when building software in systems with both gtk2 and gtk3

Do you have both gtk2 che gtk3 installed on your Slackware box and sometimes gtk3 based programs compilation fails because the building script can’t find the right version of the library? If the answer to the question is “Yes” maybe you can find a solution to your problem using the following trick.