Simple method to construct flat-band lattices