Selective recovery of valuable metals from mine water