Socio-economical dynamics as a solvable spin system on co-evolving networks