Ok, well, you only really need four numbers. I would use float or double as gallons and total gallon instead of ints, so to be more precise. Have num1 and num2, just as you have. Then have totalGallons, which will hold the sum of all the inputs so far, and then have a totalMiles variable.
Your while loop should be
instead of num1>=-1 because that would include -1, and the loop wouldn't end when you inputted -1.
Inside the while loop, first of all, add num1 to totalGallons. Ask for num2. Add num2 to total miles.
There's no need for that second loop.
Simply print out miles per gallon by totalGallons/totalMiles. Use a float to be more precise.