Automorphic lie algebras and cohomology of root systems