score:11
IAD is indeed a dreadful airport. A new train system has very slightly improved matters. From the exit past customs to the furthest gate at remote terminals can take 20 minutes easily. You will miss your connection if (a) your incoming flight is late, (b) the Border entry officer hassles you, (c) your luggage, which I believe you will have to re-check, is slow. For international flights, the luggage at least is not usually a problem. However, you will make your flight with a reasonable quantum of luck. Although the computer should know, tell the customer service personnel that you are transferring: they may hold the Buffalo flight a few minutes.
Now, yes, if you are on a continuous ticket, Lufthansa will be responsible for rebooking you. Unfortunately, I only see one non-stop a day IAD-BUF, so you will end up on some circuitous route. Check the schedule for your flight day to know what options to ask them to rebook on.