Formation of the young compact cluster GM 24 triggered by a cloud-cloud collision