Here is how I finally managed to solve the problem, after talking to a colleague who had already been through it [it was actually not necessary to follow the steps that you suggested]:
- I installed the packages "libafterimage0" and "libafterimage-dev" to Debian, using the Synaptic Package Manager.
After that I could return to the point where I was before, when I built root from source to introduce Threads in an application.
Thank you very much for your unvaluable attention. If you don't have any other comments to add I could close this post.