Implemented user casting

Improve Makefile, use pkg-config for library search