You use -99 in your input file to indicate end of line, but you seem to expect -999 in your program . . . .
Just a thought: why don't you read in one line at a time, and treat that as the row of a matrix. That way you don't need any terminating numbers at all, which are really more trouble than they're worth.
#include <iostream>
#include <sstream>
#include <string>
std::string line;
for(int row = 0; std::getline(infile, line); row ++) {
std::istringstream stream(line); // create a stringstream with the line from the file
int number;
while(stream >> number) {
graph[row].insertLast(number);
}
}