Try boiling vegetables like cabbage and carrots with a little garlic and some chicken (for flavouring) and adding it into the diet. Mix the boiled vegetables with the regular food. The vegetables will help make the stools more solid. Also add some plain yoghurt (no sugar) with live cultures in with your dog's food. Your dog's stomach bacteria may need some boosting.
Both the vegetables and yoghurt are perfectly safe things to add to your dog's diet to improve his stool formation.
Hope this helps.
"The greatness of a nation can be judged by the way its animals are treated" Mahatma Ghandi.