Man thanks lifeguards who saved him