Fixed #1268: Memory Counters not working
Fixing current compilation problems
added default value for "LIB" cmake variable