Measuring closures at 50m
Looking at that library it uses the internal pull-ups on the AVR which are quite weak. It might be worth adding some 1K pull-up resistors on the rows and see how that goes to drive the lines harder. Also take a look in the code and see how long the delay is between driving the row and reading the column, it might be worth adding a delay in case capacitance over the long cable length is coming into play.

A more robust solution would be to use a microcontroller at the keypad end and transmit the data back using something like the RS 485 standard that is based on a differential balanced line. That could be done quite cheaply but would involve quite a bit of extra research / effort.