Slow-release fertilizers solve a lot of those problems, and you can indeed make NH3 without fossil fuels, using solar / wind power to split water to generate the necessary hydrogen for the Haber-Bosch process. Mining the potash might be the more serious long-term issue though.