Makefile and heap in merge file

1) A simple make file to compile friends example on *nix. I'll add make files to other examples.
2) Use heap to improve performance of do_merge_file.