The primary problem here is the active GP vs total guild GP. The problem is if you have a whale guild join a war down a few members and match down (some are doing it on purpose now, it is being planned/exploited), you become matched with a guild that will:
-Have less of the key characters
-have way slower mod speed averages
-Have less geared toons
The combo of those 3 things makes the war virtually impossible to win. The best solution is to, as others have stated base it on total GP of the guild of all 50 members. This immediately levels the playing field. Yes you can still have a 50 member guild that has focused on all the wrong things and is still out matched, but there should be an advantage to the guilds specifically recruiting people focused on TW and having TW rosters.
BUT WAIT, the next problem would be a guild purposefully dropping members out of that total GP, as they join TW (which will happen). So to me the best thing would be to take the average GP of all members currently in the guild and create the matchmaking total based on 50 members of that average.
Overall though, this problem is only going to get worse now as I have heard guilds are actively having members sit out of wars on a rotation so they get the mismatch, and always win.
Not fun to be on the receiving end.
As for the less than 50 member problem, I do not know how you would ever properly tackle guilds joining wars with less than 50 members fairly, as again as soon as you match down characters/gears/mods all come into play not just GP. To me you have the system try and match based on the GP average system I outlined in combo with the member count that joined the war, but if no opponent can be found with a similar active member count, its tough cookies and you are matched to your same average GP opponent and are short handed. Competitive TW guilds would have to push max/complete participation, which is how it should be.