Once you build your first ship, go to the Fleet screen, select the ship you just built then select Export on the command bar to the right. This will save your ship. Once your ship is saved make sure you are still on the Fleet screen. Make sure the ship you just saved is still selected, then cleck on Remove Ship from the right command bar. The computer will ask you to confirm the decomission of your ship. Click on Confirm. This will remove your ship and return the credits you spent to build it.
After you have been given the credits, go to the right command bar on the Fleet screen and select Import Ship. Find the folder you saved you previous ship at and select the saved ship file (it should look similar to this: NCC12345) and click open. This will put the ship you saved back into your fleet list of ships. All you have to do now is select this ship again and choose Remove ship and confirm the decomission. The credits you spent making the ship will once again be added to your total credits. Repeat as much as necessary. Lots of Credits to build and have fun with!