Ideally Lily would see her veterinarian for an examination and blood tests and/or a urinalysis to make sure that she is healthy otherwise internally. In an older pup we worry about underlying metabolic diseases (for example early kidney failure) that lead to slight dehydration and thus dry, hard to pass stools that move poorly through the gastrointestinal tract. They can also check her anal glands to make sure they are overfull, or impacted or look for a tumor causing difficulty passing stools.
If her exam and blood tests look normal sometimes the gastrointestinal tract simply slows down with age and that allows the stool to dry out too much making it difficult to pass.
If she has some spinal arthritis perhaps that too is affecting the nerves to her colon such that they aren't working as well as they should and that is slowing down her colonic motility. Spinal arthritis can also make it painful to get into position and stay in position to pass stools, so they may struggle because they hurt.
In cases with altered motility and metabolic diseases I recommend feeding canned foods to increase water consumption and improve hydration. We may also need to use a higher fiber diet to stimulate colonic motility, for example using a high fiber senior food, or adding fiber to her usual diet.
Fiber works as a stimulant to get the colon moving. You can add 1 tablespoon of fresh cooked or canned pumpkin (not pie filling, plain pumpkin) to each meal for fiber. It is also high in moisture which helps too. Feed 2-3 meals a day rather than one big meal to keep the gut stimulated and moving.
Make sure to feed canned food, add water or low salt chicken broth to improve her hydration and offer plenty of water to drink. Perhaps a dog water fountain will encourage her to drink more.
It is more common in cats but some dogs with chronic constipation can get a condition called megacolon, where the colon loses its propulsive, muscular function and stools sit in it becoming large, dry and difficult to pass. More common in males than females, but chronic straining and weakening of the pelvic muscles can lead to a perineal hernia.
If you want to try things at home first then as I listed above I recommend:
1) adding lots of fluids to her diet.
2) I would feed a senior canned food only, and add warm water or low salt chicken broth,
3) Add pumpkin to every meal.
4) Feeding at least 2 to 3 times daily. The more often she eats the more her gut is stimulated to move.
5) If she has a history of joint disease or arthritis then giving an omega 3 fatty acid (Welactin is excellent) and a glucosamine/chondroitin (Glycoflex or Cosequin are both very good) would be recommended.
If that isn't enough she will need to see her veterinarian to look for any underlying health issues.
It has been my pleasure to help you today, and I hope that I have earned my 5 star rating. Please remember to rate my service by selecting the 5 stars at the top of the screen (rating me now does not close your question). You are welcome to ask follow up questions about my response here until you are satisfied, simply use the reply box and let me know. Thank you!