Place potatoes, onion, and cubed ham in large stockpot. Cover with water. Cook until potatoes are almost tender.
Remove about one cup of the cooked potatoes and mash in a bowl with the back of a fork. Add some of the liquid from the pan (about a tablespoon at a time) along with the flour till you have a thick paste. Add this back to the pot.
Place the cheese (either whole of cubed) in the pot. Let the soup simmer until the cheese melts and is thick. Add ground black pepper to taste and stir in the milk.