Is this actually supposed to be a frosting (fluffy, spreadable) or a glaze (to pour on the cake)? If it's a glaze, there are a couple of things that help me. (1) You're doing right to add the sugar a little at a time, but did you sift it? Sifting it as you add it can help eliminate lumps. (2) You may not need as much sugar as the recipe calls for. Just add enough to get the glaze to the desired consistency--thickened, but pourable (not too runny). Pour it over the cake, and let it sit. It should harden somewhat as it sits.
Most glazes can be adjusted somewhat after you combine all the ingredients. If they're too thin, you can add a little more sifted sugar. If they're too thick, you can add a LITTLE more milk. Just do it promptly. You don't want it to sit too long before you try to adjust it.