DC motor & microcontroller sharing power suply: dc motor shuts off after a few seconds of running
When the motor starts rotating, it will draw a "start up" current, the stall current.
It's quite likely it pulls down the 5V.  Use decoupling capacitors as shown in the schematic below. 



Value of the resistor depends on the supply current of the attiny85. I assumed a big 10mA, causing an acceptable 100mV drop across the resistor. The supply current is probably lower.  

The 100uF is also indicative; it depends on the stall current the rated 3V motor draws on 5V (so, not the datasheet value, but about 5/3 times bigger).