Exact solutions to a generalized Benjamin-Bona-Mahony equation