He must be related at least to Stanley Dunham, because he looks just like him.
Pictures of Stanley Armour Dunham flashing his “big smile” look much like Barry flashing his “big smile.” Even though Malcolm X's “big smile is also similar, I prefer to go with Occam's Razor and stick with Grampa Stanley as the source of the smile, although appearance can mean very little when determining paternity it won't hold up in court.
The only resemblance I see between Barry and Malcolm X is the general shape of the head and the teeth, but none of the finer features look very similar to me.
BO looks exactly like Stanley Ann