Mac Lane method of group cohomologies and Gauge theories on finite lattices