Can you build a battery from scratch which is able to make a computer run?
Yes, but it would likely be neither cheap nor compact.

Essentially you would have to 


pick a chemistry
make a string of sufficient cells in series to provide acceptable input voltage
make sufficient "strings" to provide adequate output current


You would almost certainly want to pick a rechargeable chemistry, which suggests either lead-acid or NiFe ("Edison"). NiCad is too poisonous and the higher-density lithium ones are too flammable.

There's a community of people building DIY NiFe batteries for use with off-grid renewable energy. Google will show you plans. Or you can look at Edison's original patents.