Build liblights from common and fix build error