First, we need to prioritize which problems we're solving. That doesn't mean ignoring environmental impacts of lithium mining or whatever else you had in mind, but it means that we can't let ourselves be trapped in the status quo of greenhouse gas emissions for fear of jumping into a slightly less deep pit.Lithium batteries are involved with solar energy and they aren't so environmentally friendly.
Second, lithium batteries are not intrinsically tied to solar power. They're just one means used to buffer the power generated. There are lots of other energy storage techniques being researched and employed, but it takes a lot of time to build out the generation capacity and we can't afford to wait for the perfect energy storage solution in order to get started.