BSD compat

@maxenglander

OK, getting back into this. You're already way ahead. I'm having some issues compiling and running p3.

I had to make the following for BSD compatibility, since it lacks a `getline` function... after this, it compiles fine, but it fails when running against `kargerMinCut.txt` with the error `pointer being freed was not allocated`. I should say I am not very familiar with `fgetln` but I think it should be working here.

GDB suggests it is a call to `free` in `vertex_destroy`.

ideas? something about how I changed the code?