Fix the build

Patched the sources and add a Makefile to make BeTeX build on Haiku. The app
runs altough with very limited functionality (Layout is broken, the preview
does not seem to work, occassional crashes...).
Fix crashes on creating popup dialogs
Fetch the dimensions of inserted objects correctly