Enable support for recent versions of the pin toolkit

Recent versions of pin have a modified Makefile infrastructure.
This commit makes the sampler work with this new infrastructure.
Fix a compilation error on recent gcc

Recent versions of gcc don't allow an implicit cast of an integer to a smaller integral type.
This commit adds an explicit cast where needed to fix this error.