This was user error. I had to set the LWIP_TCP_KEEPALIVE in the compile options like -DLWIP_TCP_KEEPALIVE. Once I did this then I did not get any errors when setting the options.