Optimal Controllers to Improve Transient Recovery of Grid-Following Inverters Connected to Weak Power Grids