score:6
That's tight but should be doable. You can check recent immigration wait times here: https://awt.cbp.gov/ using your specific arrival time and weekday. Average wait times are about 20 minutes but max wait times can exceed an hour. It's hard to predict.
Once your through immigration you need to collect your bags , walk through customs, and then drop them off at the bag drop right after the exit. There is typically no wait times at customs, but you won't know for sure until you get there.
I think you arrive and depart both from Terminal D so you can just walk over to security and enter the gate area.
If everything is normal, you'll be fine but there isn't much room for error (delayed incoming flight, slow immigration, misplaced bag, customs want to see your bag, long line and secuity, etc.).
If you miss it, LH UA will rebook you to the next available flight for free but you will probably have to stay the night. Your flight to Frankfurt is the last one that either UA or LH operate from Houston to Germany. There is an 8:25pm United going to London which could get you there the same day but will incur another stop to get from London to Frankfurt.