Objects on the Detail side of a master-detail relationship cannot exist independently - they must be related to a master object at the time of their creation. This can't be changed without altering the relationship itself.
If your database already contains the relevant master objects, you can take a couple of different approaches depending on what your data model actually looks like.
If you have an external Id field on the master, you can perform an upsert operation in Data Loader and match the relationship field on your incoming detail objects against that external Id, which you'd populate in your incoming data. For example, if you are importing Opportunity Line Items and you have a "Job Id" in your file that corresponds to an External Id on the Opportunity, you can perform an upsert against that field to identify the master objects.
If you do not have such a situation, you can pull down your master data using a Data Loader export operation and manually match the Ids of the desired master objects against your detail file, possibly using an
INDEX/MATCH construct in Excel to identify the correct master record based in the information you have for the detail.