The Gale-Berlekamp game for Hadamard matrices