Build fixes

I was having problem with building on OSX.

Fixed backslashes in `Makefile.am``

Regenerate ``gram.h`` and add built ``gram.h`` from ``gram.y``

Remove ``extern`` causing link error.

I think these fixes are correct for other platforms...