Applied most of http://bibl4.oru.se/projects/rdesktop/patch19/patches/Makefile.diff, which makes it possible to compile on for example Solaris without trouble.