fix some minor calling issues and begin pkg-config support

fix some minor calling issues and begin pkg-config support
also backpacking ribasushi's request (according to Lancaster Consensus) 'cause he stated he would fix open issues with 5.6.