Some fixes to link unittest with libs